//
//  ReadBookMarkViewController.m
//  NeteaseNews
//
//  Created by liutaifeng on 16/4/22.
//  Copyright © 2016年 liutaifeng. All rights reserved.
//

#import "ReadBookMarkViewController.h"
#import "LTFReadBookMarkView.h"
#import "LTFReadDetailViewController.h"
@interface ReadBookMarkViewController ()
<
 LTFReadBookMarkViewDelegate
>
@property (nonatomic, retain) LTFReadBookMarkView *bookMarkView;
@property (nonatomic, retain) UIView *myView;
@property (nonatomic, retain) UIButton *button;
@property (nonatomic, retain) UILabel *label;
@end


@implementation ReadBookMarkViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self createView];
}
- (void)createView {
    
    self.bookMarkView = [[LTFReadBookMarkView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    [self.view addSubview:self.bookMarkView];
    [_bookMarkView release];
    self.bookMarkView.dalegate = self;
    
        self.myView = [[[UIView alloc] initWithFrame:CGRectMake(0, 24, self.view.frame.size.width, 40)] autorelease];
        _myView.backgroundColor = [UIColor redColor];
    
        self.button = [UIButton buttonWithType:UIButtonTypeSystem];
        _button.frame = CGRectMake(0, 0, 40, 40);
    [_button setImage:[UIImage imageNamed:@"fanhui.png"] forState:UIControlStateNormal];
        [_myView addSubview:_button];
    _button.tintColor = [UIColor whiteColor];
    [_button addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
    
    self.label = [[UILabel alloc] initWithFrame:CGRectMake(40, 0, 200, 40)];
    [_myView addSubview:_label];
    _label.textColor = [UIColor whiteColor];
    _label.text = @"订阅更多网易号";
    
}

- (void)click:(UIButton *)button {
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewWillAppear:(BOOL)animated {
    [self.navigationController.view addSubview:_myView];
    UITableView *leftTableView = [self.view viewWithTag:1004];
    UITableView *rightTableView = [self.view viewWithTag:1005];
    [leftTableView reloadData];
    [rightTableView reloadData];
}
- (void)viewWillDisappear:(BOOL)animated {
    [_myView removeFromSuperview];
}

- (void)sendAddress:(NSString *)address title:(NSString *)title{
    LTFReadDetailViewController *detailVC = [[LTFReadDetailViewController alloc] init];
    [self.navigationController pushViewController:detailVC animated:YES];
    detailVC.string = address;
    detailVC.str = title;
    [detailVC release];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */
@end
